import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class FileText {

	public static void main(String[] args) throws IOException{
		FileText ft = new FileText();
		File file = new File("C:/ftpDownload/CF02010420");
		InputStreamReader read = new InputStreamReader(new FileInputStream(file),"gbk");
		BufferedReader br = new BufferedReader(read);
		String s = null;
		List<Map<String,String>> lstData = new ArrayList<Map<String,String>>();
        while((s = br.readLine())!=null){//使用readLine方法，一次读一行
    		Map map = ft.getDataMap(s);
    		System.out.println(map);
        }
        br.close();
	}
	
	public Map<String,String> getDataMap(String oneLine){
		String oldData = oneLine;
		Map<String,String> dataMap = new HashMap<String,String>();
		String filds[] = {"RM31TRDDAT","RM31TRDTIM","RM31TRDSEQ","RM31INISYS","RM31INICHN","RM31SRCSYS",
				"RM31SRCCHN","RM31PREDAT","RM31PRESEQ","RM31FRZDAT","RM31SYSCOD","RM31FRZNBR","RM31FRZACT",
				"RM31FRZACS","RM31BUSTYP","RM31OPTFLG","RM31WENDAT","RM31OPTAMT","RM31HANNAM","RM31CERTYP",
				"RM31CERNBR","RM31ORGLEV","RM31ORGTYP","RM31ORGNAM","RM31INFNBR","RM31PNAM1","RM31PTEL1",
				"RM31PEMP1","RM31POFF1","RM31PNAM2","RM31PTEL2","RM31PEMP2","RM31POFF2","RM31WTRORG",
				"RM31TRDTLR","RM31ATH1","RM31ATH2","RM31ATH3","RM31ATH4","RM31ACCNBR","RM31WREM1",
				"RM31WREM2","RM31WREM3","RM31WREM4","RM31FRZCRD","RM31FRZCCY","RM31FRZFLG","RM31FRZSTS",
				"RM31MENDAT","RM31FRZAMT","RM31CONFLG","RM31AUTREM","RM31MTRORG","RM31MREM1","RM31MREM2",
				"RM31MREM3","RM31MREM4"};
		int fildLens[] = {10,8,8,2,2,2,2,10,30,10,2,12,22,6,3,1,10,15,62,1,21,1,1,62,30,62,20,30,30,62,20,
				30,30,5,6,6,6,6,6,64,32,62,62,15,22,2,1,1,10,15,1,1,5,32,62,62,15};
		for(int i = 0;i<filds.length;i++){
			try {
				String oneFild = oneLine.substring(0, fildLens[i]);
				oneLine = oneLine.substring(fildLens[i], oneLine.length());
				dataMap.put(filds[i], oneFild);
			} catch (Exception e) {
				System.out.println("数据长度异常！："+oldData);
			}
		}
		return dataMap;
	}
}
